package cn.foolishbird.crow.pay;


import cn.foolishbird.crow.pay.request.ConfirmPaymentRequest;
import cn.foolishbird.crow.pay.request.NotifyRequest;
import cn.foolishbird.crow.pay.request.RefundNotifyRequest;
import cn.foolishbird.crow.pay.response.ProOrderResponse;

/**
 * @author foolish-bird
 */
public interface ThirdPayment extends Payment {

    /**
     * 确认支付
     * @param request
     * @return
     * @throws Exception
     */
    ProOrderResponse confirmPayment(ConfirmPaymentRequest request) throws Exception;

    /**
     * 支付回调通知
     *
     * @param notify
     * @return
     */
    void payNotify(NotifyRequest notify) throws Exception;

    /**
     * 退款回调通知
     *
     * @param notify
     * @return
     */
    void refundNotify(RefundNotifyRequest notify) throws Exception;

    /**
     * 获取解析类型
     *
     * @return
     */
    AnalysisStrategy defaultAnalysisStrategy();

    /**
     * 解析的策略名
     *
     * @param analysisName
     * @return
     */
    AnalysisStrategy analysisStrategy(String analysisName);

}
